<template>
  <div class="wrap">
    <div class="flex_cen_cen nav">
      <u-search v-model="params.name" :input-style="{height: '72rpx'}" :show-action="false" placeholder="请输入顾客姓名进行筛选" />
    </div>
    <div class="list">
      <AutoList :params="params" :request="getSubscribeList" mb="130" @list="list = $event">
        <div
          v-for="d in list"
          :key="d.id"
          class="item"
        >
          <div class="title">
            <span>{{ d.customerName }}</span>
            <span :style="{fontSize: '28rpx', color: '#ff8802'}">{{ d.state }}</span>
          </div>
          <LabelAndValue :value="d.appointmentTime" height="70" label="预约到院时间" />
          <div class="hospital">
            <span style="width: 30%;height: 100%;line-height: 35px;color: rgba(0,0,0,.45);padding-left: 10px;">预约医院</span>
            <div style="width: 70%;height: 35px;display: flex;justify-content: flex-end;align-items: center;color: rgba(0, 0, 0, .85);font-weight: 500;">
              <!-- 第一个Icon是挡枪的 -->
              <Icon name="icon-fangzi222" size="52" />
              <Icon name="icon-fangzi222" size="52" />
              <!-- <div :class="['t-icon', 'icon-fangzi222', 'autoBG']"
                   style="width: 52rpx; height: 52rpx;"
              /> -->
              {{ d.hospitalName }}
            </div>
          </div>
          <LabelAndValue :value="d.customerMobile" height="70" label="顾客手机号" />
          <div class="btn">
            <Button type="solid" @confirm="goInfo(d)">查看详情</Button>
          </div>
        </div>
      </AutoList>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { reactive, ref } from 'vue'
import AutoList from '@C/AutoList.vue'
import LabelAndValue from '@C/LabelAndValue.vue'
import Button from '@C/Button.vue'
import Icon from '@C/Icon.vue'
import { getSubscribeList } from '@P/Custom_GL/Operation/request'
import type { IObj, IObjArray } from '@/interface'
import { Router } from '@/router'

// 参数
const params = reactive({
  name: '',
})

// 列表
const list = ref(<IObjArray>[])
// 去详情
const goInfo = (data: IObj) => Router.push('gl_subscribe_info', data)

</script>

<style lang="less" scoped>
.wrap {
  height: calc(100vh - 100rpx);
  display: flex;
  flex-direction: column;
  .nav {
    padding: 20rpx 30rpx;
    background-color: #fff;
  }
  .list {
    flex: 1 1;
    padding: 20rpx;
  }
  .item {
    background: white;
    border-radius: 24rpx;
    margin-bottom: 28rpx;
    padding-right: 16rpx;
  }
  .btn {
    height: 118rpx;
    text-align: right;
    margin: 16rpx auto 0;
    width: calc(100% - 56rpx);
    padding: 28rpx 0;
    border-top: solid 1rpx #f2f2f2;
  }
  .title {
    font-size: 32rpx;
    margin: auto;
    width: calc(100% - 56rpx);
    height: 100rpx;
    color: #272727;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: solid 2rpx #e5e5e5;
  }
  .hospital {
    width: 100%;
    display: flex;
    font-size: 14px;
  }
}
</style>
